// 房东相关请求

import { DeleteParams, DataListParams, DataListResultModel, CheckParams } from './model'
import { defHttp } from '/@/utils/http/axios'
import { ErrorMessageMode } from '/@/utils/http/axios/types'

enum Api {
    DataListUrl = '/videos/list',
    deleteurl = '/videos/delete',
    checkUrl = '/videos/check',
}

/**
 * @description: 获取视频列表
 */
export function listDataApi(params: DataListParams, mode: ErrorMessageMode = 'modal') {
    return defHttp.request<DataListResultModel>(
        {
            url: Api.DataListUrl,
            method: 'POST',
            params,
        },
        {
            errorMessageMode: mode,
        }
    )
}

/**
 * @description: 删除
 */
export function deleteApi(params: DeleteParams, mode: ErrorMessageMode = 'modal') {
    return defHttp.request(
        {
            url: Api.deleteurl,
            method: 'POST',
            params,
        },
        {
            errorMessageMode: mode,
        }
    )
}

/**
 * @description: 审核
 */
export function checkApi(params: CheckParams, mode: ErrorMessageMode = 'modal') {
    return defHttp.request(
        {
            url: Api.checkUrl,
            method: 'POST',
            params,
        },
        {
            errorMessageMode: mode,
        }
    )
}
